<!DOCTYPE html >
<html xmlns:th="http://www.thymeleaf.org">

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <title>编辑</title>

    <link rel="stylesheet" type="text/css" href="/static/css/bootstrap.min.css">
    <link rel="stylesheet" type="text/css" href="/static/fonts/line-icons.css">
    <link href="/static/plugins/datatables/dataTables.bootstrap4.min.css" rel="stylesheet" type="text/css"/>
    <link href="/static/plugins/datatables/buttons.bootstrap4.min.css" rel="stylesheet" type="text/css"/>
    <link href="/static/plugins/datatables/responsive.bootstrap4.min.css" rel="stylesheet" type="text/css"/>
    <link rel="stylesheet" type="text/css" href="/static/css/main.css">
    <link rel="stylesheet" type="text/css" href="/static/css/responsive.css">

</head>
<body>
<div class="app header-default side-nav-dark">
    <div class="layout">
        <!--顶部栏-->
        <div th:replace="~{/topbar::topbar}">
        </div>
        <!--侧边栏-->
        <div th:replace="~{/sidebar::sidebar}">
        </div>
        <!--主体部分-->
        <div class="page-container">

            <div class="main-content">
                <div class="container-fluid">

                    <div class="breadcrumb-wrapper row">
                        <div class="col-12 col-lg-3 col-md-6">
                            <h4 class="page-title">合同信息一览表</h4>
                        </div>
                    </div>

                </div>
                <div class="container-fluid">
                    <div class="row">
                        <div class="col-md-10">
                            <span class="badge badge-default">合同管理</span>
                            <br>
                            <br>
                            <form id="projectForm" method="post" onsubmit="return f()">
                                <div class="form-group">
                                    <label for="Input9">合同名称</label>
                                    <input type="text" class="form-control" id="Input9" name="name"
                                           th:value="${contract.getName()}" style="width:300px; height:40px;">
                                    <input type="hidden"  id="id" name="id" th:value="${contract.getId()}">
                                </div>
                                <div class="form-group">
                                    <label for="Input10">合同编号</label>
                                    <input type="text" class="form-control" id="Input10" name="cid"
                                           th:value="${contract.getCid()}" style="width:300px; height:40px;">
                                </div>
                                <div class="form-group">
                                    <label for="Input11">负责人</label>
                                    <input type="text" class="form-control" id="Input11" name="leader"
                                           th:value="${contract.getLeader()}" style="width:300px; height:40px;">
                                </div>
                                <div class="form-group">
                                    <label for="Input12">合同类别</label>
                                    <select class="form-control" id="Input12" name="cType" th:value="${contract.getcType()}" style="width:300px; height:40px;">
                                        <option value="开发">开发</option>
                                        <option value="服务">服务</option>
                                    </select>
                                </div>
                                <div class="form-group">
                                    <label for="Input13">计划类别</label>
                                    <select class="form-control" id="Input13" name="planType" th:value="${contract.getPlantype()}" style="width:300px; height:40px;">
                                        <option value="国家、部门计划">国家、部门计划</option>
                                        <option value="地、市、县计划">地、市、县计划</option>
                                        <option value="省、自治区、直辖市及计划单列市计划">省、自治区、直辖市及计划单列市计划</option>
                                    </select>
                                </div>
                                <div class="form-group">
                                    <label for="Input14">生效日期</label>
                                    <input type="date" class="form-control" id="Input14" name="effectiveDate"
                                           th:value="${contract.getEffectiveDate()}"style="width:300px; height:40px;">
                                </div>
<!--                                <div class="form-group">-->
<!--                                    <label for="projectFile">-->
<!--                                        项目文档-->
<!--                                    </label>-->
<!--                                    <input type="file" class="form-control-file" id="projectFile" name="projectFile"/>-->
<!--                                </div>-->
                                    <button type="submit" class="btn btn-primary">确认</button>
                            </form>
                        </div>
                    </div>
                </div>
                <footer class="content-footer">
                    <div th:replace="~{/footer::footer}"></div>
                </footer>

            </div>

        </div>
    </div>
</div>
<script src="/static/js/jquery-min.js"></script>
<script src="/static/js/popper.min.js"></script>
<script src="/static/js/bootstrap.min.js"></script>
<script src="/static/js/scripts.js"></script>
<script src="/static/js/jquery.app.js"></script>
<script src="/static/js/main.js"></script>

<script src="/static/plugins/datatables/jquery.dataTables.min.js"></script>
<script src="/static/plugins/datatables/dataTables.bootstrap4.min.js"></script>

<script src="/static/plugins/datatables/dataTables.buttons.min.js"></script>
<script src="/static/plugins/datatables/buttons.bootstrap4.min.js"></script>
<script src="/static/plugins/datatables/jszip.min.js"></script>
<script src="/static/plugins/datatables/pdfmake.min.js"></script>
<script src="/static/plugins/datatables/vfs_fonts.js"></script>
<script src="/static/plugins/datatables/buttons.html5.min.js"></script>
<script src="/static/plugins/datatables/buttons.print.min.js"></script>
<script src="/static/plugins/datatables/buttons.colVis.min.js"></script>
<script src="/static/plugins/datatables/dataTables.responsive.min.js"></script>
<script src="/static/plugins/datatables/responsive.bootstrap4.min.js"></script>
<script src="/static/js/datatables.init.js"></script>

<script type="text/javascript">
    function f() {
        var formData = new FormData($('#projectForm')[0]);
        //formData.append("isChange","yes");
        $.ajax({
            url: "/project/edit",
            type: "post",
            data: formData,
            processData: false,
            contentType: false,
            success: function (result) {
                if (result && result.success) {
                    alert("提交成功");
                    window.location.href = "/project/contract";
                } else {
                    alert(result.msg);
                }
            }
        });
        return false;
    }
</script>
</body>
</html>